package com.xyz.tasks.controller;

import com.free.common.vo.ResultModel;
import com.free.ext.logger.FreeLogger;
import com.free.ext.logger.FreeLoggerFactory;
import com.xyz.tasks.bf.LotteryCalcuateBf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TaskController {

    private static final FreeLogger LOG = FreeLoggerFactory.getLogger(TaskController.class);

    @Autowired
    private LotteryCalcuateBf calcuateBf;

    @RequestMapping(value = "/task/calculate.json")
    @ResponseBody
    public ResultModel calculatePeriod(String lotteryCode){
        LOG.info("当前活动{}", lotteryCode);
        return calcuateBf.getLotteryRes(lotteryCode);
    }

}
